'****************************************************************************'
'                                                                            '
' Copyright (C) 2010 Muhammad alaa                                           '
'                                                                            '
' This program is free software; you can redistribute it and/or modify       '
' it under the terms of the GNU General Public License as published by       '
' the Free Software Foundation; either version 2 of the License, or          '
' (at your option) any later version.                                        '
'                                                                            '
' This program is distributed in the hope that it will be useful,            '
' but WITHOUT ANY WARRANTY; without even the implied warranty of             '
' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the              '
' GNU General Public License for more details.                               '
'                                                                            '
' You should have received a copy of the GNU General Public License along    '
' with this program; if not, write to the Free Software Foundation, Inc.,    '
' 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.                '
'                                                                            '
'****************************************************************************'

Namespace COM

    <ComImport()> _
    <InterfaceType(ComInterfaceType.InterfaceIsIUnknown)> _
    <Guid(IID.COM.ICallFrame)> _
    Public Interface ICallFrame
        <PreserveSig()> Function GetInfo(<Out()> ByRef pInfo As CallFrameInfo) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function GetIIDAndMethod(<Out()> ByRef pIID As Guid, <Out()> ByRef piMethod As UInteger) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function GetNames(<MarshalAs(UnmanagedType.LPWStr), Out()> ByRef pwszInterface As String, <MarshalAs(UnmanagedType.LPWStr), Out()> ByRef pwszMethod As String) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function GetStackLocation() As IntPtr
        <PreserveSig()> Sub SetStackLocation(ByVal pvStack As IntPtr)
        <PreserveSig()> Sub SetReturnValue(<MarshalAs(UnmanagedType.Error)> ByVal hr As HResult)
        <PreserveSig()> Function GetReturnValue() As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function GetParamInfo(ByVal iparam As UInteger, <Out()> ByRef pInfo As CallFrameParamInfo) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function SetParam(ByVal iparam As UInteger, ByVal pvar As Object) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function GetParam(ByVal iparam As UInteger, <Out()> ByRef pvar As Object) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function Copy(ByVal copyControl As CallFrameCopy, ByVal pWalker As ICallFrameWalker, <Out()> ByVal ppFrame As ICallFrame) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function Free(ByRef pframeArgsDest As ICallFrame, ByRef pWalkerDestFree As ICallFrameWalker, ByRef pWalkerCopy As ICallFrameWalker, ByVal freeFlags As CallFrameFree, ByVal pWalkerFree As ICallFrameWalker, ByVal nullFlags As CallFrameNull) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function FreeParam(ByVal iparam As UInteger, ByVal freeFlags As CallFrameFree, ByRef pWalkerFree As ICallFrameWalker, ByVal nullFlags As CallFrameNull) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function WalkFrame(ByVal walkWhat As CallFrameWalk, ByRef pWalker As ICallFrameWalker) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function GetMarshalSizeMax(ByRef pmshlContext As CallFrameMarshalContext, ByVal mshlflags As MshlFlags, <Out()> ByRef pcbBufferNeeded As UInteger) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function Marshal(ByRef pmshlContext As CallFrameMarshalContext, ByVal mshlflags As MshlFlags, ByVal pBuffer As IntPtr, ByVal cbBuffer As UInteger, <Out()> ByRef pcbBufferUsed As UInteger, <Out()> ByRef pdataRep As UInteger, <Out()> ByRef prpcFlags As UInteger) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function Unmarshal(ByVal pBuffer As IntPtr, ByVal cbBuffer As UInteger, ByVal dataRep As UInteger, ByRef pcontext As CallFrameMarshalContext, <Out()> ByRef pcbUnmarshalled As UInteger) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function ReleaseMarshalData(ByVal pBuffer As IntPtr, ByVal cbBuffer As UInteger, ByVal ibFirstRelease As UInteger, ByVal dataRep As UInteger, ByRef pcontext As CallFrameMarshalContext) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function Invoke(ByVal pvReceiver As IntPtr) As <MarshalAs(UnmanagedType.Error)> Integer
    End Interface

End Namespace
